// url路径格式化
export function formatURL(url, prefix) {
  if (!url || typeof url !== 'string') return ''
  if (!prefix) return url
  const Expression = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/
  const objExp = new RegExp(Expression)
  if (objExp.test(url)) {
    return url
  }
  return `${prefix}${url}`
}
